
const state = {
  activeIndex: 0,
  calculateId: null,
  // 记录编辑器的内容，用于添加公式页面跳转回来回显
  contentHtml: '',
  // 重定向的url
  redirect: '',
  // 记录状态（编辑、新增），默认新增
  calculateType: 'add'
}

const getters = {

}

const mutations = {
  SETACTIVEINDEX(state, index) {
    state.activeIndex = index
  },
  SETCALCULATEID(state, id) {
    state.calculateId = id
  },
  CLEARCALCULATEID(state) {
    state.calculateId = null
  },
  SETCONTENT(state, contentHtml) {
    state.contentHtml = contentHtml
  },
  CLEARCONTENT(state) {
    state.contentHtml = ''
  },
  SETREDIRECT(state, redirect) {
    state.redirect = redirect
  },
  SETCALCULATETYPE(state, calculateType) {
    state.calculateType = calculateType
  }
 }

const actions = {

}

export default {
  namespaced: true,
  state,
  getters,
  mutations,
  actions
}